package cn.yhr.summerboot.web;


import cn.yhr.summerboot.context.IocApplication;
import cn.yhr.summerboot.context.SummerApplication;
import org.apache.catalina.LifecycleException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Tittle DispatcherServlet
 * @Description
 * @Author yhr
 * @Date 2019/1/11 10:33
 * @Version 1.0
 */
@WebServlet(urlPatterns = "/*")
public class DispatcherServlet extends HttpServlet {

    IocApplication ioc;

    @Override
    public void init() throws ServletException {
        this.ioc = IocApplication.getApplication();
        super.init();
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doGet厉害了!");
        return;
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doPost厉害了!");
        return;
    }

    @Override
    protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doPut厉害了!");
        return;
    }

    @Override
    protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doDelete厉害了!");
        return;
    }
}
